cmake_minimum_required(VERSION 3.27)
project(luajitter)

set(CMAKE_CXX_STANDARD 14)

set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/../lib)
include_directories(.)
include_directories(include)

# 可以选择生成静态库或共享库
# add_library(luajitter SHARED
add_library(luajitter STATIC
        include/lauxlib.h
        include/lua.h
        include/lua.hpp
        include/luaconf.h
        include/luajit.h
        include/lualib.h
        #go_callbacks.c
        #go_callbacks.h
        go_diag_memory.c
        go_diag_memory.h
        go_luaerrors.c
        go_luaerrors.h
        go_luainterface.c
        go_luainterface.h
        go_luajit.c
        go_luajit.h
        go_luatypes.c
        go_luatypes.h
        go_pools.c
        go_pools.h)

# 如果需要导出符号，可以考虑以下设置
# set_target_properties(luajitter PROPERTIES
#     OUTPUT_NAME "luajitter"
#     VERSION "1.0"
#     SOVERSION "1")